Directional Types for Logic Programs and the Annotation Method Directional Types for Logic Programs and the Annotation Method
نویسنده
چکیده
A directional type for a Prolog program expresses certain properties of the operational semantics of the program. This paper shows that the annotation proof method, proposed by Deransart for proving declarative properties of logic programs, is also applicable for proving correctness of directional types. In particular, the suucient correctness criterion of well-typedness by Bronsard et al, turns out to be a specialization of the annotation method. The comparison shows a general mechanism for construction of similar specializations, which is applied to derive yet another concept of well-typedness. The usefulness of the new correctness criterion is shown on examples of Prolog programs, where the traditional notion of well-typedness is not applicable. We further show that the new well-typing condition can be applied to diierent execution models. This is illustrated by an example of an execution model where uniication is controlled by directional types, and where our new well-typing condition is applied to show the absence of deadlock. Types ech es pour programmes logiques et m ethode de preuve par annotation R esum e : Types ech es pour un programme Prolog expriment certaines propri et es opera-tionelles de celui-ci. Cet article montre que la m ethode de preuve par annotation, propos ee par Deransart pour prouver des propri et es d eclaratives de programmes logiques, est egalement appliquable pour d emontrer la correction des types ech es. En particulier, le crit ere de bon typage propos e par Bronsard et al, se trouve ^ etre un cas particulier de la m ethode de preuve par annotation. La comparaison r ev ele un m ecanisme g en eral pour concevoir des sp ecialisations similaires. Celui-ci est appliqu e pour d eenir un nouveau crit ere de bon typage. L'utilit e de ce nouveau crit ere est d emontr ee sur des exemples de programmes Prolog, auxquels l'ancienne notion de bon typage n'est pas appliquable. Nous montrons aussi que ce nouveau crit ere peut ^ etre appliqu e a diierents mod eles d'ex ecution. Ceci est illustr e par un mod ele d'ex ecution o u la r esolution d' equations est contr^ ol ee par des types ech es, et o u notre nouveau crit ere de bon typage est utilis e pour d emontrer l'absence de \deadlock".
منابع مشابه
Directional Types and the Annotation Method
A directional type for a Prolog program expresses certain properties of the operational semantics of the program. This paper shows that the annotation proof method, proposed by Deransart for proving declarative properties of logic programs, is also applicable for proving correctness of directional types. In particular, the suucient cor-rectness criterion of well-typedness by Bronsard et al, tur...
متن کاملUsing parametric set constraints for locating errors in CLP programs
This paper introduces a framework of parametric descriptive directional types for constraint logic programming (CLP). It proposes a method for locating type errors in CLP programs and presents a prototype debugging tool. The main technique used is checking correctness of programs w.r.t. type speciications. The approach is based on a generalization of known methods for proving correctness of log...
متن کاملType Dependencies for Logic Programs Using ACI-Unification
This paper presents a new notion of typing for logic programs which generalizes the notion of directional types. The generation of type dependencies for a logic program is fully automatic and optimal with respect to a given domain of types. The analysis method is based on a novel combination of program abstraction and ACI-uniication. The method is both theoretically clean and easy to implement ...
متن کاملDirectional Type Inference for Logic Programs
We follow the set based approach to directional types proposed by Aiken and Lakshman Their type checking algorithm works via set constraint solving and is sound and complete for given discriminative types We characterize directional types in model theoretic terms We present an algorithm for inferring directional types The directional type that we derive from a logic program P is uniformly at le...
متن کاملThe Design of half-subtractor Logic Function Based on Nonlinear Directional Coupler
In this paper a novel design of all-optical half-subtractor based on nonlinear directional coupler is proposed. By using four waveguides and appropriately adjusting the refractive indices and selecting the proper length of waveguides, halfsubtractor function can be obtained. The operation of this function is simulated by RSoft CAD-Layout (BeamPROP) simulator. The simulation results confirm the ...
متن کامل